import request from '@/utils/request'

// 为什么 import request from '@/utils/request'？ 因为utils/request下可以拿到BASE_API
export default{
  //1.查询所有课程分类信息
  getAllSubject(){
      return request({
          url: '/edu/subject/getAllSubject',
          method: 'get',
        })
  },
  //2. 根据id删除节点
  deleteSubjectById(subjectId){
    return request({
        url: '/edu/subject/'+subjectId,
        method: 'delete',
      })
},
  //3. 添加一级分类
  saveParentSubject(eduSubject){
    return request({
        url: '/edu/subject/saveParentSubject',
        method: 'post',
        params:eduSubject
      })
},

  //4. 添加二级分类
  saveChildSubject(eduSubject){
    return request({
        url: '/edu/subject/saveChildSubject',
        method: 'post',
        params:eduSubject
      })
}
}